﻿Imports Microsoft.VisualBasic

Namespace My
    Public Structure RegionType
        Public Shared Town As New RegionType("T")
        Public Shared Village As New RegionType("V")
        Public Shared County As New RegionType("C")

        Private valueField As String

        Public ReadOnly Property Value()
            Get
                Return Me.valueField
            End Get
        End Property

        Public Sub New(ByVal value As String)
            Me.valueField = value
        End Sub

        Public Shared Operator =(ByVal value1 As RegionType, ByVal value2 As RegionType) As Boolean
            If value1.Value = value2.value Then
                Return True
            Else
                Return False
            End If
        End Operator

        Public Shared Operator <>(ByVal value1 As RegionType, ByVal value2 As RegionType) As Boolean
            If value1.Value <> value2.Value Then
                Return True
            Else
                Return False
            End If
        End Operator

        Public Overrides Function ToString() As String
            Return Me.Value
        End Function
    End Structure
End Namespace

